<html>
<head>
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
 <title>JavaScript oninput and onpropertychangte Event Alternative</title>

 <script type="text/javascript">
/**
 * event handler to be fired if the content of input element have changed.
 */
function eventHandler() {
  // write your own event handler here.
  document.getElementById('info').innerHTML = 'input content changed to ' +
    document.getElementById('input').value;
}

/**
 * Variable which keeps track of the content of input element
 * @type {string}
 */
INPUT_CONTENT = '';

/**
 * Check input element periodically.
 */
polling = function() {
  if (INPUT_CONTENT != document.getElementById('input').value)
    eventHandler();

  // update INPUT_CONTENT
  INPUT_CONTENT = document.getElementById('input').value;

  // polling interval: 500ms.
  // you can change the polling interval to fit your need.
  setTimeout(polling, 500);
};
 </script>

</head>
<body>
 <div>
  <input id="input" type="text" />
 </div>
 <div id="info"></div>

 <script type="text/javascript">
  // start to polling input element
  polling();

  // focus to input element.
  document.getElementById('input').focus();
 </script>
</body>
</html>
